home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
public
/
Xprof
/
xprof
/
profile.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
6KB
|
199 lines
/*==================================================================
* File : profile.h
* Package: Xprof
*
* Author : Aloke Gupta.
*
* (C) Copyright 1992, Aloke Gupta.
*==================================================================*/
/* Declarations for the profiler code. */
#ifndef _PROFILE_H_
#define _PROFILE_H_
#include <X11/Xlib.h>
typedef enum {
INSTALL, NOINSTALL
} Install;
typedef enum {
VALID = 0, INVALID = -1
} Valid;
double get_net_latency() ;
double get_net_speed() ;
float get_request_time(/*int index, Xattributes *attributes */);
/* Each request has one instance of the following data structure.
* Depending on the msgclass of the request, the relevant member of the
* union is chosen to hang the cost list of the requests.
*/
typedef union _MsgCost {
struct _CostCell *win; /* Points to list of costs */
struct _GfxCost *gfx; /* Array of GfxCost */
struct _TxtCost *txt; /* Array of TxtCost */
} MsgCost;
typedef struct _CostCell {
float size; /* Size for which this measurement was made ?*/
float speed; /* Speed in size units per second ? */
struct _CostCell *nextcost; /* Next data point for size and speed thereof*/
} CostCell;
typedef struct _GfxCost {
CostCell *costlist;
} GfxCost;
typedef struct _TxtCost {
CostCell *costlist;
} TxtCost;
/*
* The following defines are intimately related to the indices of the entries
* in the GxmodeTable structure array defined in gc.c
*/
#define GXCLEAR 0
#define GXAND 1
#define GXANDREVERSE 2
#define GXCOPY 3
#define GXANDINVERTED 4
#define GXNOOP 5
#define GXXOR 6
#define GXOR 7
#define GXNOR 8
#define GXEQUIV 9
#define GXINVERT 10
#define GXORREVERSE 11
#define GXCOPYINVERTED 12
#define GXORINVERTED 13
#define GXNAND 14
#define GXSET 15
/* The following is defined in gc.c as the sizeof GxmodeTable */
extern unsigned int MAXGXMODES;
/*
* The following defines are intimately related to the indices of the entries
* in the LineStyleTable structure array defined in gc.c
*/
#define LINESOLID 0
#define LINEONOFFDASH 1
#define LINEDOUBLEDASH 2
/* The following is defined in gc.c as the sizeof GxmodeTable */
extern unsigned int MAXLINESTYLES;
/*
* The following defines are intimately related to the indices of the entries
* in the LineStyleTable structure array defined in gc.c
*/
#define FILLSOLID 0
#define FILLOPAQUESTIPPLED 1
#define FILLSTIPPLED 2
#define FILLTILED 3
/* The following is defined in gc.c as the sizeof GxmodeTable */
extern unsigned int MAXFILLSTYLES;
/*
* Instances of the following structure are used to manage the mappings of
* attributes in Xprof. Not all attributes are actually present in the
* performance metrics supplied by Xmeasure. The ones not present are simulated
* by other ones as decided by the entry "where" in the structure below.
*/
typedef struct _AttributesTable {
int index; /* This should be equal to the actual array index */
char *xprof_name; /* Name of this attribute as used in the Xprof package*/
char *xscope_name; /* Name of this attribtue as used in Xscope */
int where; /* Which index contains actual value of this attribute*/
int value; /* Actual value. (-1) if meaningless */
} AttributesTable;
#define XPROF_GXMODES 2
#define XPROF_LINESTYLES 2
#define XPROF_FILLSTYLES 2
#define XPROF_LINEWIDTHS 4
#define MASK2 0x01
#define MASK4 0x03
#define GFXSLOTS (XPROF_GXMODES * XPROF_LINESTYLES * XPROF_FILLSTYLES * XPROF_LINEWIDTHS)
#define GFXINDEX(gxmode, linestyle, fillstyle, linewidth) ( \
((gxmode & MASK2) ) | \
((linestyle & MASK2) << 1) | \
((fillstyle & MASK2) << 2) | \
((linewidth & MASK4) << 3) )
#define TXTSLOTS 32
/*
*Define the equivalences for the various attributes
*/
/* gxmode: copy and xor are the only ones maintained */
#define XPROF_GXCOPY 0
#define XPROF_GXXOR 1
/* All other gxmodes are treated as follows:
* one operand gxmode => copy */
#define XPROF_GXCLEAR XPROF_GXCOPY
#define XPROF_GXNOOP XPROF_GXCOPY
#define XPROF_GXINVERT XPROF_GXCOPY
#define XPROF_GXCOPYINVERTED XPROF_GXCOPY
#define XPROF_GXSET XPROF_GXCOPY
/* two operand gxmode => xor */
#define XPROF_GXAND XPROF_GXXOR
#define XPROF_GXANDREVERSE XPROF_GXXOR
#define XPROF_GXANDINVERTED XPROF_GXXOR
#define XPROF_GXOR XPROF_GXXOR
#define XPROF_GXNOR XPROF_GXXOR
#define XPROF_GXEQUIV XPROF_GXXOR
#define XPROF_GXORREVERSE XPROF_GXXOR
#define XPROF_GXORINVERTED XPROF_GXXOR
#define XPROF_GXNAND XPROF_GXXOR
/* linestyle: LineSolid and LineOnOffDash are the only ones maintained */
#define XPROF_LINESOLID 0
#define XPROF_LINEDOUBLEDASH 1
#define XPROF_LINEONOFFDASH XPROF_LINEDOUBLEDASH
/* fillstyle: FillSolid and FillOpaqueStippled are the only ones maintained */
#define XPROF_FILLSOLID 0
#define XPROF_FILLOPAQUESTIPPLED 1
#define XPROF_FILLSTIPPLED XPROF_FILLOPAQUESTIPPLED
#define XPROF_FILLTILED XPROF_FILLOPAQUESTIPPLED
typedef struct _XprofGCvalues {
long id; /* ID assigned by X window server */
int function; /* What boolean function ? */
int line_width; /* Actual width of drawn line */
int line_style;
int fill_style;
struct _FontVal *fontval;
struct _XprofGCvalues *next;
} XprofGCvalues;
typedef struct _FontVal {
long id;
char *fontname;
struct _FontVal *next;
} FontVal;
typedef struct _Xattributes {
XprofGCvalues *gcval; /* pointer to graphics values */
long bytes;
float size;
unsigned int width, height;
int angle1, angle2; /* for arcs */
} Xattributes;
typedef struct _ProfileStats { /* These are all kept in milliseconds */
double net_time; /* Time spent by the message in the network */
double cpu_time; /* Cpu time at the display-server */
double total_time;
Valid cpu_valid; /* Is the cpu_time data valid ? */
} ProfileStats;
#endif /* #ifndef _PROFILE_H_ */